#include <bits/stdc++.h>
using namespace std;
int a[10000];
// {0, 3, 4, 4, 7, 8, 9, 9, 9, 9, 10};

int longest(int x[], int n) {
  int ans = 0; // 擂主
  int len = 1;
  for (int i = 2; i <= n; i++) {
    if (x[i] == x[i - 1]) {
      len++;
      ans = max(ans, len);
    } else {
      len = 1;
    }
  }
  return ans;
}

int longest2(int x[], int n) {
  int len = 1;
  for (int i = 2; i <= n; i++) {
    if( x[i]==x[i-len])
      len++;
  }
  return len;
}

int main() {

  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }

  cout << longest2(a, n);
  return 0;
}
